/*
pGina ldapAuth code - based upon skeleton code for pGina plugin development
Copyright (C) 2002 Micah Cooper

This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.

Email: coopermj@muohio.edu
Snail Mail:
	Micah Cooper
	212A Kreger Hall
	Miami University
	Oxford OH  45056
*/
#pragma once

#include "Resource.h"

// CConfigLDAP dialog

class CConfigLDAP : public CDialog
{
	DECLARE_DYNAMIC(CConfigLDAP)

public:
	CConfigLDAP(CWnd* pParent = NULL);   // standard constructor
	virtual ~CConfigLDAP();
    void loadListsFromReg(void); // load the lists from the registry
    void saveListsToReg(void); // save the lists to the registry

// Dialog Data
	enum { IDD = IDD_LDAP_TAB };

protected:
	virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support

	DECLARE_MESSAGE_MAP()
public:
   // Used to display the LDAPAuth Version
      CString m_server;
      CString m_ldapPrePend;
      CString m_ldapAppend;
      CString m_ldapAdminUsername;
      CString m_ldapAdminPassword;
      BOOL m_useSSL;
      CString m_port;
      CString m_ldapFilter;
      CString m_ldapGroupAttr;
      BOOL m_searchMode;
      BOOL m_multiMap;
      BOOL m_mapMode;
      CListBox m_ContextList;
      CString m_newContext;
	  CString m_timeout;
	  bool hasLoaded;

	  void swapItem(CListBox *,int, int);
	  afx_msg BOOL OnInitDialog();
	  afx_msg void OnOK();
	  afx_msg void OnSave();
	  afx_msg void OnAddContext();
	  afx_msg void OnRemoveContext();
	  afx_msg void OnMoveContextUp();
	  afx_msg void OnMoveContextDown();
	  afx_msg void OnChangeSearch();
	  afx_msg void OnChangeMultimap();
	  afx_msg void OnChangeMapMode();
protected:
	// Control display of ldapPrePend field
	CEdit c_ldapPrePend;
public:
	CEdit c_ldapAppend;
	CButton c_usessl;
	CEdit c_newcontext;
	CButton c_addcontext;
	CButton c_delcontext;
	CButton c_upcontext;
	CButton c_downcontext;
	afx_msg void OnEnChangeLdapfilter();
	afx_msg void OnEnChangeTimeout();
};
